package personal.lijun.skeleton.springcloud.common.data.security;

/**
 * @Auther: lijun@sstcsoft.com
 * @Date: 2019-10-15 10:11
 */
public class CurrentLoginUserHolder {

    private static ThreadLocal<CurrentLoginUser> loginUser = new ThreadLocal<>();

    /**
     * 获取当前登录用户信息
     * @return
     */
    public static CurrentLoginUser getCurrentLoginUser(){
        return loginUser.get();
    }

    /**
     * 设置登录用户信息
     * @param currentLoginUser
     */
    public static void setCurrentLoginUser(CurrentLoginUser currentLoginUser){
        loginUser.set(currentLoginUser);
    }
}
